import request from '@/utils/request'

// 省  市  渠道代理列表  (1:省代理 2:市代理 3:渠道商)
export function getAgentsList (params) {
  return request({
    url: '/back/xsAgent/getAgents',
    method: 'get',
    params
  })
}

//删除

export function delAgent (params) {
    return request({
      url: '/back/xsAgent/delAgent',
      method: 'DELETE',
      params
    })
  }

//新增

export function addAgent (data) {
    return request({
      url: '/back/xsAgent/addAgent',
      method: 'post',
      data
    })
  }

//修改
export function setAgentArea (data) {
  return request({
    url: '/back/xsAgent/setAgentArea',
    method: 'PUT',
    data
  })
}

//申请加盟列表

export function getParnerListConditionByPage (params) {
    return request({
      url: '/back/xsParner/getParnerListConditionByPage',
      params
    })
  }
  
//加盟详情

export function getParnerInfo (params) {
    return request({
      url: '/back/xsParner/getParnerInfo',
      params
    })
  }

// 加盟驳回  通过 面谈
export function updateParnerStatus (params) {
  return request({
    url: '/back/xsParner/updateParnerStatus',
    method: 'put',
    params
  })
}

//商家列表

export function getBusinessList (params) {
  return request({
    url: '/back/xsBusiness/getBusinessList',
    params
  })
}

//商户详情

export function getBusinessInfo (params) {
  return request({
    url: '/back/xsBusiness/getBusinessInfo',
    params
  })
}

//删除商户

export function delBusiness (params) {
  return request({
    url: '/back/xsBusiness/delBusiness',
    method: 'DELETE',
    params
  })
}


//分类列表
export function getSort (params) {
  return request({
    url: '/back/xsSort/getSort',
    params
  })
}

// 新增商户
export function addBusiness (data) {
  return request({
    url: '/back/xsBusiness/addBusiness',
    method: 'post',
    data
  })
}


// 修改商户信息
export function updateBusiness (data) {
  return request({
    url: '/back/xsBusiness/updateBusiness',
    method: 'put',
    data
  })
}

//新增品类
export function addSort (data) {
  return request({
    url: '/back/xsSort/addSort',
    method: 'post',
    data
  })
}

//修改品类
export function updateSort (data) {
  return request({
    url: '/back/xsSort/updateSort',
    method: 'PUT',
    data
  })
}

//删除品类
export function delSort (params) {
  return request({
    url: '/back/xsSort/delSort',
    method: 'delete',
    params
  })
}

// 导入
export function importingAgent (data) {
  return request({
    url: '/back/xsAgent/importingAgent',
    method: 'post',
    data
  })
}